package com.masterclient.app.businessmodule.vipmodule.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eoner.baselibrary.utils.GlideUtil;
import com.eoner.baselibrary.utils.Utils;
import com.masterclient.app.R;
import com.masterclient.app.businessmodule.vipmodule.bean.ProfitOrder;
import com.masterclient.app.widget.CircleImage;

public class ProfitAdapter extends BaseQuickAdapter <ProfitOrder, BaseViewHolder> {

    private String statusName="";
    public ProfitAdapter() {
        super(R.layout.adapter_profit);
    }

    public void setStatusName(String statusName){
        this.statusName = statusName;
    }
    @Override
    protected void convert(BaseViewHolder helper, ProfitOrder item) {
        TextView textView = helper.getView(R.id.status_tv);
        TextView numTv = helper.getView(R.id.num_tv);
        TextView nameTv = helper.getView(R.id.name_tv);
        CircleImage headIv = helper.getView(R.id.head_iv);
        TextView timeTv = helper.getView(R.id.time_tv);
        TextView totalTv = helper.getView(R.id.total_tv);
        TextView yongjTv = helper.getView(R.id.yongjin_tv);
        textView.setText(item.getProfit_status_desc());
        String num = mContext.getString(R.string.order_num);
        numTv.setText(String.format(num,item.getOrder_no()));
        String time = mContext.getString(R.string.order_time);
        timeTv.setText(String.format(time,item.getOrder_create_at()));
        Utils.setDin(totalTv, mContext);
        Utils.setDin(yongjTv, mContext);
        totalTv.setText("¥ "+item.getOrder_subtotal());
        yongjTv.setText("¥ "+item.getAll_money());
        nameTv.setText(item.getShow_name());
        String avatar = item.getAvatar();
        if (null != avatar)
            GlideUtil.displayImage(mContext, avatar, headIv, R.mipmap.user_head_default_icon);

    }
}
